#!/bin/sh
# =====================================================
# /logcheck/etc/syslog-clear.sh
# version: 1.0
# Date: 10/29/2011
# Company: feinno
# URL: www.feinno.com
# Email: changfg@fetionyy.com.cn
# crontab "15      1       *       *       1       sh /usr/local/logcheck/etc/syslog-clear.sh >/dev/null 2>&1"
# =====================================================

# -------------------------
# set default static values
# -------------------------
HOME=/logcheck/etc
SYSLOGDIR=/var/log/syslog-ng
MIGRATE=${HOME}/migrate
IGNORE=${HOME}/tmp/ignores
LOGTAIL=${HOME}/tmp/logtail

# --------------------
# hold log for 1 month
# --------------------
find $SYSLOGDIR -mtime +10 -type f -exec rm {} \;
find $MIGRATE -mtime +10 -type f -exec rm {} \;
find $IGNORE -mtime +10 -type f -exec rm {} \;
find $LOGTAIL -mtime +1 -type f -exec rm {} \;

exit 0
